package com.kfm.base.io.c;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class Exer {

    public static void main(String[] args) {
        try (BufferedReader br = new BufferedReader(new FileReader("text/csb.txt"))) {
            List<String> list = new ArrayList<>();

            String line;
            while ((line = br.readLine()) != null) {
                list.add(line);
            }

            list.sort((a, b) -> {
                return a.compareToIgnoreCase(b);
            });

            for (String s: list){
                System.out.println(s);
            }
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
